<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <title>测评问卷</title>
    <style>
        body{margin-left:5%; margin-right:5%; margin-top:2%; margin-bottom:10%;}
    </style>    
</head>
<body>
    <h1>{{ testpaper.title }}</h1>
    <h4>{{ testpaper.description }} </h4>
    <label>姓名：{{ answerpaper.testee }} </label>
    <label>电话：{{ answerpaper.telphone }} </label>
    <form action="{% url 'result' answerpaper.id %}" method="post">
        {% csrf_token %}
        {% for subject in testpaper.subject_set.all %}
            <p>
            {{ forloop.counter }}, {{ subject.title }}</br>
            {% for option in subject.ops.all %}
                <input type="radio" name="choice{{ subject.id }}" id="choice{{ forloop.counter }}" value="{{ forloop.counter }}"  required>
                <label>{{ option.get_options_display }},{{ option.content }} &nbsp;&nbsp;&nbsp;&nbsp; </label>
            {% endfor %}
            </p>
        {% endfor %}        
        <br><p><input type="submit" name="result" value="提交问卷" style="width:100px; height:40px"></p>        
    </form>
</body>
</html>
